#define _CRT_SECURE_NO_WARNINGS 1
#include"stack.h"

void stack_init(stack* st)
{
	for (int i = 0; i < 10; i++)
	{
		st->data[i] = 0;
	}
	st->size = -1;
	st->capacity = 10;
}

void StackPush(stack* st,DataType x)
{
	assert((st->size + 1) < st->capacity);
	st->size++;
	st->data[st->size] = x;
}

void StackPrint(stack* st)
{
	assert(st);
	assert(st->data);
	for (int i = 0; i <= st->size; i++)
	{
		printf("%d ", st->data[i]);
	}
	printf("\n");
}

void StackPop(stack* st)
{
	assert((st->size) > -1);
	st->size--;
}